using MicroMsg.UI.Page;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace MicroMsg.UI.UserContrl
{
	public class HubPlugWideCtrl : HubPluginCtrlBase
	{
		private bool autoAnimate;
		private bool isLoaded;
		internal ClickEffectGrid btnLayoutRoot;
		internal StackPanel panelContent;
		internal CompositeTransform transContent;
		internal Grid gridPrePage;
		internal Grid gridOriginPage;
		internal Image imgIcon;
		internal DynamicTextBlock txtTitle;
		internal Image flagIcon;
		internal TextBlock txtNotifyCnt;
		private bool _contentLoaded;
		protected override Grid GridPrePage
		{
			get
			{
				return this.gridPrePage;
			}
			set
			{
				this.gridPrePage = value;
			}
		}
		protected override CompositeTransform TransContent
		{
			get
			{
				return this.transContent;
			}
			set
			{
				this.transContent = value;
			}
		}
		protected override Image FlagIcon
		{
			get
			{
				return this.flagIcon;
			}
			set
			{
				this.flagIcon = value;
			}
		}
		protected override TextBlock TxtNotifyCnt
		{
			get
			{
				return this.txtNotifyCnt;
			}
			set
			{
				this.txtNotifyCnt = value;
			}
		}
		protected override DynamicTextBlock TxtTitle
		{
			get
			{
				return this.txtTitle;
			}
			set
			{
				this.txtTitle = value;
			}
		}
		protected override Image ImgIcon
		{
			get
			{
				return this.imgIcon;
			}
			set
			{
				this.imgIcon = value;
			}
		}
		public HubPlugWideCtrl(bool autoAni = false)
		{
			this.InitializeComponent();
			this.autoAnimate = autoAni;
			base.add_Loaded(new RoutedEventHandler(this.HubPlugWideCtrl_Loaded));
		}
		private void HubPlugWideCtrl_Loaded(object sender, RoutedEventArgs e)
		{
			if (!this.isLoaded && this.autoAnimate)
			{
				CircleHubPrevCtrl instance = CircleHubPrevCtrl.getInstance();
				if (instance.ItemObject == null)
				{
					instance.SetDefaultImg();
				}
				this.isLoaded = true;
			}
		}
		protected override void adjustFlagImagePosition()
		{
			if (R.isEnglish())
			{
				this.flagIcon.set_Margin(new Thickness(0.0, 0.0, 2.0, 10.0));
				return;
			}
			this.flagIcon.set_Margin(new Thickness(0.0, 0.0, 10.0, 10.0));
		}
		protected override void RefreshItem()
		{
			if (base.ItemObject == null)
			{
				base.set_Visibility(1);
				return;
			}
			base.set_Visibility(0);
			this.imgIcon.set_Source(base.ItemObject.mIconInFFEntry);
			this.txtTitle.Text = base.ItemObject.mFFEntryTitle;
			this.flagIcon.set_Source(base.ItemObject.mIconFlagInFFEntry);
			this.flagIcon.set_Visibility(base.ItemObject.isShowFlagImage() ? 0 : 1);
		}
		private void btnLayoutRoot_Click(object sender, object args)
		{
			base.LayoutRoot_Click(sender, args);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/CommonUseControl/HubPlugWideCtrl.xaml", 2));
			this.btnLayoutRoot = (ClickEffectGrid)base.FindName("btnLayoutRoot");
			this.panelContent = (StackPanel)base.FindName("panelContent");
			this.transContent = (CompositeTransform)base.FindName("transContent");
			this.gridPrePage = (Grid)base.FindName("gridPrePage");
			this.gridOriginPage = (Grid)base.FindName("gridOriginPage");
			this.imgIcon = (Image)base.FindName("imgIcon");
			this.txtTitle = (DynamicTextBlock)base.FindName("txtTitle");
			this.flagIcon = (Image)base.FindName("flagIcon");
			this.txtNotifyCnt = (TextBlock)base.FindName("txtNotifyCnt");
		}
	}
}
